ROW = 5
COL = 9
walk = [(-1, 2), (1, 2), (-2, 1), (2, 1)]
ans = []

def horse_walk(remote, x, y):
    global ans
    if x == ROW-1 and y == COL-1:
        ans.append(remote[:])
    for i in walk:
        nx, ny = x+i[0], y+i[1]
        if x+nx >= 0 and nx < ROW and ny >= 0 and ny < COL:
            horse_walk(remote+[(nx, ny)], nx, ny)

horse_walk([], 0, 0)
for i in ans:
    print("0,0", end='')
    for j in i:
        print("->"+str(j[0])+","+str(j[1]), end='')
    print("")
